<template>
  <div class="">
    <div class="">
      <!-- :scroll="{ x: 400, y: 280 }" -->
      <a-table class="item_table" :columns="columns2" :data-source="dataRelayList" :pagination="false" bordered>
      </a-table>
    </div>
  </div>
</template>

<script>
import { httpAction, getAction } from '../../api/manage'
export default {
  props: {},
  components: {},

  data() {
    return {
      columns2: [
        {
          title: '序号',
          dataIndex: '',
          key: 'rowIndex',
          width: 80,
          align: 'center',
          customRender: function(t, r, index) {
            return parseInt(index) + 1
          }
        },
        {
          title: '告警时间',
          dataIndex: 'createTime',
          key: 'createTime'
        },
        {
          title: 'CPU温度',
          dataIndex: 'cpuTemperature',
          key: 'cpuTemperature'
        },
        {
          title: 'CPU型号',
          dataIndex: 'cpuModel',
          key: 'cpuModel'
        },
        {
          title: 'CPU使用率',
          dataIndex: 'cpuUsage',
          key: 'cpuUsage'
        },
        {
          title: '告警类型',
          dataIndex: 'cpuAlarmLevel',
          key: 'cpuAlarmLevel'
        },
        {
          title: 'DAC工作状态',
          dataIndex: 'dacWorkingStatus',
          key: 'dacWorkingStatus'
        },
        {
          title: '内存告警级别',
          dataIndex: 'memoryAlarmLevel',
          key: 'memoryAlarmLevel'
        },
        {
          title: '内存空间',
          dataIndex: 'memorySpace',
          key: 'memorySpace'
        },
        {
          title: '内存使用率',
          dataIndex: 'memoryUsage',
          key: 'memoryUsage'
        },
        {
          title: '服务ip',
          dataIndex: 'serviceIp',
          key: 'serviceIp'
        },
        {
          title: '服务端口',
          dataIndex: 'servicePort',
          key: 'servicePort'
        },
        {
          title: '服务名称',
          dataIndex: 'serviceName',
          key: 'serviceName'
        },
        {
          title: '服务工作时长',
          dataIndex: 'serviceWorkingHours',
          key: 'serviceWorkingHours'
          // scopedSlots: { customRender: 'alertLevel' }
        },
        {
          title: 'DAC今日接收数据(帧)',
          dataIndex: 'dacReceivesDataToday',
          key: 'dacReceivesDataToday'
          // scopedSlots: { customRender: 'alertLevel' }
        },
        {
          title: 'DAC今日转发数据(帧)',
          dataIndex: 'dacForwardsDataToday',
          key: 'dacForwardsDataToday'
          // scopedSlots: { customRender: 'alertLevel' }
        }
      ],
      cpuData: [],
      memoryData: [],
      storageData: [],
      dataSource: [],
      dataRelayList: [],
      url: {
        cpuUrl: '/nms/monitor/cpu',
        memoryUrl: '/nms/monitor/memory',
        storageUrl: 'nms/monitor/storage',
        dataTransSys: '/nmc/dataTransSys/list'
      }
    }
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {
    this.getDataRelay()
  },
  methods: {
    getDataRelay() {
      getAction(this.url.dataTransSys).then(res => {
        console.log('res111', res)
        if (res.success) {
          this.dataRelayList = res.result.records
        }
      })
    }
  }
}
</script>

<style lang="less" scoped>
.page {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 一行 2 列 */
  gap: 16px; /* 列间距，按需调 */
}
.item {
  /* 表格宽度自适应 */
  width: 100%;
  border: 1px solid #17dcff;
  padding: 5px;
  // height: 400px;
  .item_table {
    // height: 350px;
  }
}
</style>
